#include <iostream>
#include <ctime>

int main()
{
	int a = 0;
	int b = 0;

	int answer = 1;

	int true_answers = 0;
	int questions = 0;

	std::cout << "Answer the questions (enter -1 to quit)" << std::endl << std::endl;

	std::srand(time(0));

	do
	{
		a = rand() % 10 + 1;
		b = rand() % 10 + 1;

		std::cout << a << " * " << b << " = ";
		
		questions++;

		std::cin >> answer;

		if(answer == a * b)
		{
			true_answers++; 
		}
	}
	while(answer != -1);

	std::cout << std::endl << questions - 1 << " questions (" << true_answers 
		      << " true, " << questions - 1 - true_answers << " false)\n" << std::endl;
	
	double percent = (double)(true_answers * 100) / (questions - 1);
	
	std::cout << percent <<"% true - ";

	if(percent > 80 && percent <= 100)
	{
		std::cout << "EXCELLENT\n";
	}

	if(percent > 50 && percent <= 80)
	{
		std::cout << "GOOD\n";
	}

	if(percent > 0 && percent <= 50)
	{
		std::cout << "BAD\n";
	}

	std::cout << std::endl;

	return 0;
}